3.8.14 \(\int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x)) (c-i c \tan (e+f x))^4} \, dx\) [714]

Optimal. Leaf size=181 \[ \frac {(5 A+3 i B) x}{32 a c^4}-\frac {A+i B}{32 a c^4 f (i-\tan (e+f x))}-\frac {i A+B}{16 a c^4 f (i+\tan (e+f x))^4}-\frac {A}{12 a c^4 f (i+\tan (e+f x))^3}+\frac {3 i A-B}{32 a c^4 f (i+\tan (e+f x))^2}+\frac {2 A+i B}{16 a c^4 f (i+\tan (e+f x))} \]

[Out]

1/32*(5*A+3*I*B)*x/a/c^4+1/32*(-A-I*B)/a/c^4/f/(I-tan(f*x+e))+1/16*(-I*A-B)/a/c^4/f/(I+tan(f*x+e))^4-1/12*A/a/
c^4/f/(I+tan(f*x+e))^3+1/32*(3*I*A-B)/a/c^4/f/(I+tan(f*x+e))^2+1/16*(2*A+I*B)/a/c^4/f/(I+tan(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.17, antiderivative size = 181, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 78, 209} \begin {gather*} -\frac {A+i B}{32 a c^4 f (-\tan (e+f x)+i)}+\frac {2 A+i B}{16 a c^4 f (\tan (e+f x)+i)}+\frac {-B+3 i A}{32 a c^4 f (\tan (e+f x)+i)^2}-\frac {B+i A}{16 a c^4 f (\tan (e+f x)+i)^4}+\frac {x (5 A+3 i B)}{32 a c^4}-\frac {A}{12 a c^4 f (\tan (e+f x)+i)^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*Tan[e + f*x])/((a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^4),x]

[Out]

((5*A + (3*I)*B)*x)/(32*a*c^4) - (A + I*B)/(32*a*c^4*f*(I - Tan[e + f*x])) - (I*A + B)/(16*a*c^4*f*(I + Tan[e
+ f*x])^4) - A/(12*a*c^4*f*(I + Tan[e + f*x])^3) + ((3*I)*A - B)/(32*a*c^4*f*(I + Tan[e + f*x])^2) + (2*A + I*
B)/(16*a*c^4*f*(I + Tan[e + f*x]))

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x)) (c-i c \tan (e+f x))^4} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^2 (c-i c x)^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {-A-i B}{32 a^2 c^5 (-i+x)^2}+\frac {i A+B}{4 a^2 c^5 (i+x)^5}+\frac {A}{4 a^2 c^5 (i+x)^4}+\frac {-3 i A+B}{16 a^2 c^5 (i+x)^3}+\frac {-2 A-i B}{16 a^2 c^5 (i+x)^2}+\frac {5 A+3 i B}{32 a^2 c^5 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {A+i B}{32 a c^4 f (i-\tan (e+f x))}-\frac {i A+B}{16 a c^4 f (i+\tan (e+f x))^4}-\frac {A}{12 a c^4 f (i+\tan (e+f x))^3}+\frac {3 i A-B}{32 a c^4 f (i+\tan (e+f x))^2}+\frac {2 A+i B}{16 a c^4 f (i+\tan (e+f x))}+\frac {(5 A+3 i B) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{32 a c^4 f}\\ &=\frac {(5 A+3 i B) x}{32 a c^4}-\frac {A+i B}{32 a c^4 f (i-\tan (e+f x))}-\frac {i A+B}{16 a c^4 f (i+\tan (e+f x))^4}-\frac {A}{12 a c^4 f (i+\tan (e+f x))^3}+\frac {3 i A-B}{32 a c^4 f (i+\tan (e+f x))^2}+\frac {2 A+i B}{16 a c^4 f (i+\tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.14, size = 221, normalized size = 1.22 \begin {gather*} \frac {\sec (e+f x) (\cos (4 (e+f x))+i \sin (4 (e+f x))) (-12 (15 A+i B) \cos (e+f x)+4 (-5 A+3 i B-30 i A f x+18 B f x) \cos (3 (e+f x))+9 A \cos (5 (e+f x))+15 i B \cos (5 (e+f x))+60 i A \sin (e+f x)-36 B \sin (e+f x)-20 i A \sin (3 (e+f x))-12 B \sin (3 (e+f x))-120 A f x \sin (3 (e+f x))-72 i B f x \sin (3 (e+f x))-15 i A \sin (5 (e+f x))+9 B \sin (5 (e+f x)))}{768 a c^4 f (-i+\tan (e+f x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Tan[e + f*x])/((a + I*a*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^4),x]

[Out]

(Sec[e + f*x]*(Cos[4*(e + f*x)] + I*Sin[4*(e + f*x)])*(-12*(15*A + I*B)*Cos[e + f*x] + 4*(-5*A + (3*I)*B - (30
*I)*A*f*x + 18*B*f*x)*Cos[3*(e + f*x)] + 9*A*Cos[5*(e + f*x)] + (15*I)*B*Cos[5*(e + f*x)] + (60*I)*A*Sin[e + f
*x] - 36*B*Sin[e + f*x] - (20*I)*A*Sin[3*(e + f*x)] - 12*B*Sin[3*(e + f*x)] - 120*A*f*x*Sin[3*(e + f*x)] - (72
*I)*B*f*x*Sin[3*(e + f*x)] - (15*I)*A*Sin[5*(e + f*x)] + 9*B*Sin[5*(e + f*x)]))/(768*a*c^4*f*(-I + Tan[e + f*x
]))

________________________________________________________________________________________

Maple [A]
time = 0.34, size = 148, normalized size = 0.82

method result size
derivativedivides \(\frac {\left (-\frac {5 i A}{64}+\frac {3 B}{64}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-\frac {A}{32}-\frac {i B}{32}}{-i+\tan \left (f x +e \right )}-\frac {-\frac {3 i A}{16}+\frac {B}{16}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-\frac {A}{12 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {\frac {i A}{4}+\frac {B}{4}}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {-\frac {i B}{16}-\frac {A}{8}}{i+\tan \left (f x +e \right )}+\left (\frac {5 i A}{64}-\frac {3 B}{64}\right ) \ln \left (i+\tan \left (f x +e \right )\right )}{f a \,c^{4}}\) \(148\)
default \(\frac {\left (-\frac {5 i A}{64}+\frac {3 B}{64}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-\frac {A}{32}-\frac {i B}{32}}{-i+\tan \left (f x +e \right )}-\frac {-\frac {3 i A}{16}+\frac {B}{16}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}-\frac {A}{12 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {\frac {i A}{4}+\frac {B}{4}}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {-\frac {i B}{16}-\frac {A}{8}}{i+\tan \left (f x +e \right )}+\left (\frac {5 i A}{64}-\frac {3 B}{64}\right ) \ln \left (i+\tan \left (f x +e \right )\right )}{f a \,c^{4}}\) \(148\)
risch \(\frac {3 i x B}{32 a \,c^{4}}+\frac {5 x A}{32 a \,c^{4}}-\frac {{\mathrm e}^{8 i \left (f x +e \right )} B}{256 a \,c^{4} f}-\frac {i {\mathrm e}^{8 i \left (f x +e \right )} A}{256 a \,c^{4} f}-\frac {{\mathrm e}^{6 i \left (f x +e \right )} B}{64 a \,c^{4} f}-\frac {5 i {\mathrm e}^{6 i \left (f x +e \right )} A}{192 a \,c^{4} f}-\frac {{\mathrm e}^{4 i \left (f x +e \right )} B}{64 a \,c^{4} f}-\frac {5 i {\mathrm e}^{4 i \left (f x +e \right )} A}{64 a \,c^{4} f}+\frac {\cos \left (2 f x +2 e \right ) B}{64 a \,c^{4} f}-\frac {9 i \cos \left (2 f x +2 e \right ) A}{64 a \,c^{4} f}+\frac {3 i \sin \left (2 f x +2 e \right ) B}{64 a \,c^{4} f}+\frac {11 \sin \left (2 f x +2 e \right ) A}{64 a \,c^{4} f}\) \(238\)
norman \(\frac {\frac {\left (3 i B +5 A \right ) x}{32 a c}-\frac {i A}{3 a c f}+\frac {\left (i A +3 B \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{6 a c f}+\frac {11 \left (3 i B +5 A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{96 a c f}+\frac {\left (3 i B +5 A \right ) \left (\tan ^{7}\left (f x +e \right )\right )}{32 a c f}+\frac {\left (3 i B +5 A \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{8 a c}+\frac {3 \left (3 i B +5 A \right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{16 a c}+\frac {\left (3 i B +5 A \right ) x \left (\tan ^{6}\left (f x +e \right )\right )}{8 a c}+\frac {\left (3 i B +5 A \right ) x \left (\tan ^{8}\left (f x +e \right )\right )}{32 a c}+\frac {3 \left (-i B +9 A \right ) \tan \left (f x +e \right )}{32 a c f}+\frac {\left (63 i B +73 A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{96 a c f}}{\left (1+\tan ^{2}\left (f x +e \right )\right )^{4} c^{3}}\) \(281\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x,method=_RETURNVERBOSE)

[Out]

1/f/a/c^4*((-5/64*I*A+3/64*B)*ln(-I+tan(f*x+e))-(-1/32*A-1/32*I*B)/(-I+tan(f*x+e))-1/2*(-3/16*I*A+1/16*B)/(I+t
an(f*x+e))^2-1/12*A/(I+tan(f*x+e))^3-1/4*(1/4*I*A+1/4*B)/(I+tan(f*x+e))^4-(-1/16*I*B-1/8*A)/(I+tan(f*x+e))+(5/
64*I*A-3/64*B)*ln(I+tan(f*x+e)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 6.13, size = 121, normalized size = 0.67 \begin {gather*} \frac {{\left (24 \, {\left (5 \, A + 3 i \, B\right )} f x e^{\left (2 i \, f x + 2 i \, e\right )} - 3 \, {\left (i \, A + B\right )} e^{\left (10 i \, f x + 10 i \, e\right )} - 4 \, {\left (5 i \, A + 3 \, B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} - 12 \, {\left (5 i \, A + B\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - 24 \, {\left (5 i \, A - B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 12 i \, A - 12 \, B\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{768 \, a c^{4} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="fricas")

[Out]

1/768*(24*(5*A + 3*I*B)*f*x*e^(2*I*f*x + 2*I*e) - 3*(I*A + B)*e^(10*I*f*x + 10*I*e) - 4*(5*I*A + 3*B)*e^(8*I*f
*x + 8*I*e) - 12*(5*I*A + B)*e^(6*I*f*x + 6*I*e) - 24*(5*I*A - B)*e^(4*I*f*x + 4*I*e) + 12*I*A - 12*B)*e^(-2*I
*f*x - 2*I*e)/(a*c^4*f)

________________________________________________________________________________________

Sympy [A]
time = 0.39, size = 439, normalized size = 2.43 \begin {gather*} \begin {cases} \frac {\left (\left (100663296 i A a^{4} c^{16} f^{4} - 100663296 B a^{4} c^{16} f^{4}\right ) e^{- 2 i f x} + \left (- 1006632960 i A a^{4} c^{16} f^{4} e^{4 i e} + 201326592 B a^{4} c^{16} f^{4} e^{4 i e}\right ) e^{2 i f x} + \left (- 503316480 i A a^{4} c^{16} f^{4} e^{6 i e} - 100663296 B a^{4} c^{16} f^{4} e^{6 i e}\right ) e^{4 i f x} + \left (- 167772160 i A a^{4} c^{16} f^{4} e^{8 i e} - 100663296 B a^{4} c^{16} f^{4} e^{8 i e}\right ) e^{6 i f x} + \left (- 25165824 i A a^{4} c^{16} f^{4} e^{10 i e} - 25165824 B a^{4} c^{16} f^{4} e^{10 i e}\right ) e^{8 i f x}\right ) e^{- 2 i e}}{6442450944 a^{5} c^{20} f^{5}} & \text {for}\: a^{5} c^{20} f^{5} e^{2 i e} \neq 0 \\x \left (- \frac {5 A + 3 i B}{32 a c^{4}} + \frac {\left (A e^{10 i e} + 5 A e^{8 i e} + 10 A e^{6 i e} + 10 A e^{4 i e} + 5 A e^{2 i e} + A - i B e^{10 i e} - 3 i B e^{8 i e} - 2 i B e^{6 i e} + 2 i B e^{4 i e} + 3 i B e^{2 i e} + i B\right ) e^{- 2 i e}}{32 a c^{4}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (5 A + 3 i B\right )}{32 a c^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))**4,x)

[Out]

Piecewise((((100663296*I*A*a**4*c**16*f**4 - 100663296*B*a**4*c**16*f**4)*exp(-2*I*f*x) + (-1006632960*I*A*a**
4*c**16*f**4*exp(4*I*e) + 201326592*B*a**4*c**16*f**4*exp(4*I*e))*exp(2*I*f*x) + (-503316480*I*A*a**4*c**16*f*
*4*exp(6*I*e) - 100663296*B*a**4*c**16*f**4*exp(6*I*e))*exp(4*I*f*x) + (-167772160*I*A*a**4*c**16*f**4*exp(8*I
*e) - 100663296*B*a**4*c**16*f**4*exp(8*I*e))*exp(6*I*f*x) + (-25165824*I*A*a**4*c**16*f**4*exp(10*I*e) - 2516
5824*B*a**4*c**16*f**4*exp(10*I*e))*exp(8*I*f*x))*exp(-2*I*e)/(6442450944*a**5*c**20*f**5), Ne(a**5*c**20*f**5
*exp(2*I*e), 0)), (x*(-(5*A + 3*I*B)/(32*a*c**4) + (A*exp(10*I*e) + 5*A*exp(8*I*e) + 10*A*exp(6*I*e) + 10*A*ex
p(4*I*e) + 5*A*exp(2*I*e) + A - I*B*exp(10*I*e) - 3*I*B*exp(8*I*e) - 2*I*B*exp(6*I*e) + 2*I*B*exp(4*I*e) + 3*I
*B*exp(2*I*e) + I*B)*exp(-2*I*e)/(32*a*c**4)), True)) + x*(5*A + 3*I*B)/(32*a*c**4)

________________________________________________________________________________________

Giac [A]
time = 0.95, size = 221, normalized size = 1.22 \begin {gather*} \frac {\frac {12 \, {\left (5 i \, A - 3 \, B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a c^{4}} + \frac {12 \, {\left (-5 i \, A + 3 \, B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a c^{4}} + \frac {12 \, {\left (5 \, A \tan \left (f x + e\right ) + 3 i \, B \tan \left (f x + e\right ) - 7 i \, A + 5 \, B\right )}}{a c^{4} {\left (-i \, \tan \left (f x + e\right ) - 1\right )}} + \frac {-125 i \, A \tan \left (f x + e\right )^{4} + 75 \, B \tan \left (f x + e\right )^{4} + 596 \, A \tan \left (f x + e\right )^{3} + 348 i \, B \tan \left (f x + e\right )^{3} + 1110 i \, A \tan \left (f x + e\right )^{2} - 618 \, B \tan \left (f x + e\right )^{2} - 996 \, A \tan \left (f x + e\right ) - 492 i \, B \tan \left (f x + e\right ) - 405 i \, A + 99 \, B}{a c^{4} {\left (\tan \left (f x + e\right ) + i\right )}^{4}}}{768 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="giac")

[Out]

1/768*(12*(5*I*A - 3*B)*log(tan(f*x + e) + I)/(a*c^4) + 12*(-5*I*A + 3*B)*log(tan(f*x + e) - I)/(a*c^4) + 12*(
5*A*tan(f*x + e) + 3*I*B*tan(f*x + e) - 7*I*A + 5*B)/(a*c^4*(-I*tan(f*x + e) - 1)) + (-125*I*A*tan(f*x + e)^4
+ 75*B*tan(f*x + e)^4 + 596*A*tan(f*x + e)^3 + 348*I*B*tan(f*x + e)^3 + 1110*I*A*tan(f*x + e)^2 - 618*B*tan(f*
x + e)^2 - 996*A*tan(f*x + e) - 492*I*B*tan(f*x + e) - 405*I*A + 99*B)/(a*c^4*(tan(f*x + e) + I)^4))/f

________________________________________________________________________________________

Mupad [B]
time = 9.26, size = 204, normalized size = 1.13 \begin {gather*} -\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-\frac {3\,B}{32\,a\,c^4}+\frac {A\,5{}\mathrm {i}}{32\,a\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {5\,A}{32\,a\,c^4}+\frac {B\,3{}\mathrm {i}}{32\,a\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (-\frac {9\,B}{32\,a\,c^4}+\frac {A\,15{}\mathrm {i}}{32\,a\,c^4}\right )-{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {35\,A}{96\,a\,c^4}+\frac {B\,7{}\mathrm {i}}{32\,a\,c^4}\right )-\frac {A}{3\,a\,c^4}}{f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^5-{\mathrm {tan}\left (e+f\,x\right )}^4\,3{}\mathrm {i}+2\,{\mathrm {tan}\left (e+f\,x\right )}^3-{\mathrm {tan}\left (e+f\,x\right )}^2\,2{}\mathrm {i}+3\,\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}-\frac {x\,\left (-3\,B+A\,5{}\mathrm {i}\right )\,1{}\mathrm {i}}{32\,a\,c^4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))/((a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i)^4),x)

[Out]

- (tan(e + f*x)*((A*5i)/(32*a*c^4) - (3*B)/(32*a*c^4)) + tan(e + f*x)^4*((5*A)/(32*a*c^4) + (B*3i)/(32*a*c^4))
 + tan(e + f*x)^3*((A*15i)/(32*a*c^4) - (9*B)/(32*a*c^4)) - tan(e + f*x)^2*((35*A)/(96*a*c^4) + (B*7i)/(32*a*c
^4)) - A/(3*a*c^4))/(f*(3*tan(e + f*x) - tan(e + f*x)^2*2i + 2*tan(e + f*x)^3 - tan(e + f*x)^4*3i - tan(e + f*
x)^5 + 1i)) - (x*(A*5i - 3*B)*1i)/(32*a*c^4)

________________________________________________________________________________________